package com.nts.visionworks.business.streamevent.domain;

// Generated 2013. 6. 23 ���� 6:33:40 by Hibernate Tools 4.0.0

import com.nts.visionworks.business.endpoint.domain.EndPoint;
import com.nts.visionworks.core.validation.EntityIdNotNull;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * StreamSynapse generated by hbm2java
 */
@Entity
@Table(name = "stream_synapse", catalog = "visionworks")
public class StreamSynapse implements java.io.Serializable
{

	private Long synapseId;
	private StreamEvent streamEvent;
	private EndPoint endPointBySourceEndPointId;
	private EndPoint endPointByDestinationEndPointId;
	private Set<StreamSynapseTransmitter> streamSynapseTransmitters = new HashSet<StreamSynapseTransmitter>(
			0);
	private Set<StreamSynapseCoefficient> streamSynapseCoefficients = new HashSet<StreamSynapseCoefficient>(
			0);

	public StreamSynapse()
	{
	}

	public StreamSynapse(StreamEvent streamEvent,
			EndPoint endPointBySourceEndPointId,
			EndPoint endPointByDestinationEndPointId)
	{
		this.streamEvent = streamEvent;
		this.endPointBySourceEndPointId = endPointBySourceEndPointId;
		this.endPointByDestinationEndPointId = endPointByDestinationEndPointId;
	}

	public StreamSynapse(StreamEvent streamEvent,
			EndPoint endPointBySourceEndPointId,
			EndPoint endPointByDestinationEndPointId,
			Set<StreamSynapseTransmitter> streamSynapseTransmitters,
			Set<StreamSynapseCoefficient> streamSynapseCoefficients)
	{
		this.streamEvent = streamEvent;
		this.endPointBySourceEndPointId = endPointBySourceEndPointId;
		this.endPointByDestinationEndPointId = endPointByDestinationEndPointId;
		this.streamSynapseTransmitters = streamSynapseTransmitters;
		this.streamSynapseCoefficients = streamSynapseCoefficients;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "SynapseId", unique = true, nullable = false)
	public Long getSynapseId()
	{
		return this.synapseId;
	}

	public void setSynapseId(Long synapseId)
	{
		this.synapseId = synapseId;
	}

	@EntityIdNotNull(message = "validation.streamSynapse.streamEvent.notNull")
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "EventId", nullable = false)
	public StreamEvent getStreamEvent()
	{
		return this.streamEvent;
	}

	public void setStreamEvent(StreamEvent streamEvent)
	{
		this.streamEvent = streamEvent;
	}

	@EntityIdNotNull(message = "validation.streamSynapse.endPointBySourceEndPointId.notNull")
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "SourceEndPointId", nullable = false)
	public EndPoint getEndPointBySourceEndPointId()
	{
		return this.endPointBySourceEndPointId;
	}

	public void setEndPointBySourceEndPointId(
			EndPoint endPointBySourceEndPointId)
	{
		this.endPointBySourceEndPointId = endPointBySourceEndPointId;
	}

	@EntityIdNotNull(message = "validation.streamSynapse.endPointByDestinationEndPointId.notNull")
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "DestinationEndPointId", nullable = false)
	public EndPoint getEndPointByDestinationEndPointId()
	{
		return this.endPointByDestinationEndPointId;
	}

	public void setEndPointByDestinationEndPointId(
			EndPoint endPointByDestinationEndPointId)
	{
		this.endPointByDestinationEndPointId = endPointByDestinationEndPointId;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "streamSynapse")
	public Set<StreamSynapseTransmitter> getStreamSynapseTransmitters()
	{
		return this.streamSynapseTransmitters;
	}

	public void setStreamSynapseTransmitters(
			Set<StreamSynapseTransmitter> streamSynapseTransmitters)
	{
		this.streamSynapseTransmitters = streamSynapseTransmitters;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "streamSynapse")
	public Set<StreamSynapseCoefficient> getStreamSynapseCoefficients()
	{
		return this.streamSynapseCoefficients;
	}

	public void setStreamSynapseCoefficients(
			Set<StreamSynapseCoefficient> streamSynapseCoefficients)
	{
		this.streamSynapseCoefficients = streamSynapseCoefficients;
	}

}
